

abstract  class Shape {

      abstract void draw();
      void test() {
          System.out.println("普通方法");
      }
}
class Cycle extends Shape {

    void draw() {
        System.out.println("画圆圈");
    }
}
class Rect extends Shape {

    void draw() {
        System.out.println("画矩形");
    }
}
class Flowers extends Shape {

    void draw() {
        System.out.println("❀！");
    }
}
public class Text {
    public static void drawMap(Shape shape) {
        shape.draw();
    }
    public static void main(String[] args) {
           Cycle cycle = new Cycle();
           Rect  rect = new Rect();
           Shape[] shapes = {cycle,rect};
        for (Shape shape: shapes) {
           shape.draw();
        }
    }

}
